package cartagows.wsframework.wsatomictransaction;

import java.io.Serializable;

import javax.xml.stream.XMLStreamException;

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.llom.util.AXIOMUtil;

import cartagows.wsframework.core.IOperationContent;


public class ATRegisterPartecipantContent implements IOperationContent,Serializable{

	private static final long serialVersionUID = 1L;
	private String partecipantProtocol;
	private String coordContext;
	
	public ATRegisterPartecipantContent(String partecipantProtocol, OMElement coordContext){
		this.coordContext = coordContext.toString();
		this.partecipantProtocol = partecipantProtocol;
	}

	public String getPartecipantProtocol() {
		return partecipantProtocol;
	}

	public OMElement getCoordContext() {
		OMElement returnValue = null;
		try {
			returnValue = AXIOMUtil.stringToOM(coordContext);
		}
		catch (XMLStreamException e) {
			e.printStackTrace();
		}
		return returnValue;
	}
}